<?php

namespace app\model;

use think\Model;

class Abnormal extends Model
{
    const IS_DELETE_NO = 0;

    const STATUS_TODO = 0;
    const STATUS_PROCESSED = 1;

    /**
     * @Description 判断异常Id是否存在
     * @author: zj
     * @param int $outId
     * @time 2024/03/12 14:42:22
     * @return false|mixed
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function checkOutIdIsExist(int $outId)
    {
        $info = $this->field('id')
            ->where('out_id',$outId)
            ->where('delete_time',self::IS_DELETE_NO)
            ->find();
        if (!$info) {
            return false;
        }

        return $info['id'];
    }
}